package com.biz.lambda;

import com.biz.tool.checker.fun.*;
import com.biz.tool.checker.fun.Predicate;

import java.util.function.*;

/**
 * @Description
 * @Author liuxi
 * @Date 2024/5/18
 **/
public enum ReturnHomeStrategy implements FunctionStrategy<String, Integer, String>{

    HIGH_RISK("HIGH_RISK"::equals,
            i -> {
                String s = String.valueOf(i);
                return "我得到高风险了i:" + s;
            }),
    LOW_RISK("LOW_RISK"::equals,
            i -> {
                String s = String.valueOf(i);
                return "我得到低风险了i:" + s;
            });

    private final Predicate<String> predicate;

    private final Function<Integer, String> function;

    ReturnHomeStrategy(Predicate<String> predicate, Function<Integer, String> function) {
        this.predicate = predicate;
        this.function = function;
    }

    @Override
    public Predicate<String> predicate() {
        return predicate;
    }

    @Override
    public Function<Integer, String> function() {
        return function;
    }
}
